package com.windoent.yugioh.help.db;

import android.os.Build;

import androidx.annotation.RequiresApi;

import java.util.Objects;

/**
 * author : robert
 * date   : 2021/6/15 13:15
 * desc   :
 */
public class City {
    private String code;
    private int id;
    private String name;
    private String pinyin;
    private String sort;

    public City(String code, int id, String name, String pinyin, String sort) {
        this.code = code;
        this.id = id;
        this.name = name;
        this.pinyin = pinyin;
        this.sort = sort;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPinyin() {
        return pinyin;
    }

    public void setPinyin(String pinyin) {
        this.pinyin = pinyin;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        City city = (City) o;
        return code.equals(city.code) &&
                name.equals(city.name) &&
                pinyin.equals(city.pinyin) &&
                sort.equals(city.sort);
    }

    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
    @Override
    public int hashCode() {
        return Objects.hash(code, id, name, pinyin, sort);
    }
}
